<?php
namespace app\ctrl;

use core\lib\controller;
use core\lib\library\session;
use core\lib\library\verify;

class adminCtrl extends controller
{
    public function index()
    {
        $this->display('/admin/login.html');
    }

    public function login()
    {
        $verify = new verify();
        $data = I('post.');
        if ($verify->check($data['verify'])) {
            $user = array(
                'username' => $data['username'],
                "password" => md5($data['password'])
            );
            $admin = M('admin');
            dump($admin->login($user));
        } else {
            echo 'no';
        }
    }

    public function createVerify()
    {
        $verify = new verify();
        $verify->entry();
    }

    public function test()
    {
        $s = new session();
        $s->set('laowu', 'sblaowu');
    }

    public function test1()
    {
        $s = new session();
        dump($s->get('laowu'));
    }
}